<template>
   <div class="content">
        <Tips v-show="tipShow" :msg="tips"/>
        <div class="title">
            <p>我的收藏</p>
        </div>
        <AboutList :list="collentList"/> 
   </div>
</template>

<script>
    import AboutList from '@/components/AboutList'
    import {mapState} from 'vuex'
    import Tips from '../components/Tips.vue'
    export default {
        name:"MyCollent-Component",
        components:{Tips,AboutList},
        data(){
            return {
                tipShow:false,
                tips:'',
            }
        },
        computed:{
            collentList(){
                return this.$store.state.About.collentList.reverse()
            },

            ...mapState('Home',['arouthInfo'])
        },
        methods: {
            getUserCollentList(){
                this.$store.dispatch('About/getUserCollentList','收藏')
            },
        },
        mounted() {
            //获取收藏数据
            this.getUserCollentList()
        },
    }
</script>

<style lang="less" scoped>
    .content{
        width: 100%;
        overflow: auto;
        .title{
            font-size: 1.8vw;
            margin-top: 2.6vw;

            p{
                padding-left: 1.3vw;
                margin:0 auto;
                background: #fff;
                width: 90%;
                height:5.2vw;
                line-height: 5.2vw;
            }
        }

        .list-wrap{
            margin-top: 40px;
            .list{
                width: 90%;
                margin: 0 auto;
                .item{
                    width: 100%;
                    background: #fff;
                    padding-bottom: 0.7vw;
                    margin-bottom: 1.3vw;

                    p{
                        width: 90%;
                        padding-left: 2vw;
                    }
                    .name{
                        font-size: 24.6px;
                        font-weight: 1000;
                        padding: 1.3vw 0 1.3vw 2vw;
                        cursor: pointer;

                        &:hover{
                            text-decoration: underline;
                        }
                    }
                    .content{
                        overflow: hidden;
                        display: -webkit-box;
                        text-overflow: ellipsis;
                        -webkit-line-clamp: 1;
                        -webkit-box-orient: vertical;
                    }
                    .del{
                        width: 90%;
                        height: 2vw;
                        text-align: right;
                        margin: 1.3vw 0 1.3vw 2vw;
                        color: red;
                        display: flex;
                        justify-content: right;

                        p{
                            padding: 0;
                            width: 6.5vw;
                            text-align: center;
                            height: 2vw;
                            line-height: 2vw;
                            background: red;
                            color: #fff;
                            cursor: pointer;
                            &:hover{
                                text-decoration: underline;
                                background: rgb(151, 20, 20);
                            }
                        }
                        
                    }
                }
            }
        }

        
    }
</style>